const { merge } = require("webpack-merge");
const path = require("path");
const common = require("./webpack.common.js");

module.exports = merge(common, {
  // 设置为开发模式
  mode: "development",
  devtool: "inline-source-map",
  // 配置服务端目录和端口
  devServer: {
    static: {
      directory: path.join(__dirname, "public"),
    },
    hot: true,
    port: 8080,
    proxy: {
      "/mock": {
        target: "https://library-dev.wdf.cn:7778/", //
        changeOrigin: true,
        ws: true,
        pathRewrite: {
          "^/mock": "/",
        },
      },
    },
  },
});
